package threadPool.threadExecutePool;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class ThreadPoolManager {
    public static final int BLOCK_SIZE = 100000;
    public static final int CORE_POOL_SIZE = 5;
    public static final int MAXIMUM_POOL_SIZE = 5;
    public static final int KEEP_ALIVE_TIME = 500;
    //处理回调及记录日志的线程池
    private static LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(BLOCK_SIZE);
    public static ThreadPoolExecutor threadPool =  new ThreadPoolExecutor(
            CORE_POOL_SIZE,
            MAXIMUM_POOL_SIZE,
            KEEP_ALIVE_TIME, TimeUnit.SECONDS,
            queue,
            new ThreadPoolExecutor.CallerRunsPolicy());
    
}
